package com.cskaoyan.day15;

public class CountTest {
    public static void main(String[] args) {
        String str = "abc001DEF";
        int capital = 0;
        int lowercase = 0;
        int number = 0;
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) >= 'A' && str.charAt(i) <= 'Z') {
                capital++;
            } else if (str.charAt(i) >= 'a' && str.charAt(i) <= 'z') {
                lowercase++;
            } else if (str.charAt(i) >= '0' && str.charAt(i) <= '9') {
                number++;
            }
        }
        System.out.println("大写字母字符出现" + capital + "次，小写字母字符出现" + lowercase + "次，数字字符出现" + number + "次");
    }
}
